<template>
  <div class="dieal-container">
    <div class="icon-container">
      <img
        v-if="iconType === 'url'"
        :src="require('@/assets/fy/' + icon + '.png')"
        class="icon"
      />
    </div>
    <div class="content-container">
      <div class="number" :style="{ color: numberColor }">{{ number }}</div>
      <div class="description">{{ description }}</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Dieal',
  props: {
    // 图标，可以是图片URL或CSS类名（如iconfont类名）
    icon: {
      type: String,
      required: true,
    },
    // 图标类型：'url'表示图片，'class'表示CSS类
    iconType: {
      type: String,
      default: 'url',
      validator: (value) => ['url', 'class'].includes(value),
    },
    // 数字内容
    number: {
      type: [Number, String],
      required: true,
    },
    // 数字颜色
    numberColor: {
      type: String,
      default: '#00b4ff',
    },

    // 描述文本
    description: {
      type: String,
      required: true,
    },
  },
};
</script>

<style lang="less" scoped>
.dieal-container {
  width: .9896rem;
  height: .5208rem;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  .icon-container {
    display: flex;
    align-items: center;
  }

  .content-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: .0625rem;

    .number {
      font-family: DIN;
      font-weight: bold;
      font-size: .125rem;
      color: #23fffc;
      line-height: .2344rem;
    }

    .description {
      font-family: Source Han Sans CN;
      font-weight: 500;
      font-size: .0729rem;
      color: #eaeaea;
    }
  }
}
</style>
